import java.util.ArrayList;
import java.util.Random;


public class Quest {/*
	public int rewardMoney = 0;
	public ItemKind rewardItem = null;
	public String questName = null;
	public String dialog;
	public ArrayList<String> alternativeResponses = new ArrayList<String>();
	public ArrayList<Quest> alternatives = new ArrayList<Quest>();
	public ArrayList<Boolean> alternativeNewNode = new ArrayList<Boolean>();
	public String questPic;
	public int questNo;
	public int nodeIndex = -1;
	
	public Quest(Map map, int rewardMoney, ItemKind rewardItem, String dialog, String questName, String questPic) {
		map.allQuests.add(this);
		this.questName = questName;
		this.questNo = map.allQuests.size()-1;
		this.rewardMoney = rewardMoney;
		this.rewardItem = rewardItem;
		this.dialog = dialog;
		this.questPic = questPic;
	}
	
	public Quest(Map map, Random seed) {
		map.allQuests.add(this);
		
		switch (seed.nextInt(10)){
		case 0: {
			this.questNo = map.allQuests.size()-1;
			this.rewardMoney = 0;
			this.rewardItem = null;
			this.questName = "En god gärning";
			this.dialog = "God dag, unge man. Har du lust att hjäpa en gammal man över vägen?";
			questPic = "/questPics/oldManQuest.png";
			addAlternative("Javisst",
					new Quest(map, 0, null, "[Du hjälper mannen över gatan]", this.questName , "/questPics/oldManQuest.png"),
					false);
			alternatives.get(0).addAlternative("...",
					new Quest(map, 74, null, "Tack så mycket! Ta detta som tack för hjälpen!", this.questName , "/questPics/oldManQuestPozResp.png"),
					false);
			addAlternative("AHAHAHAHAHA! Nej.",
					new Quest(map, 0, null, "Snorgärs!", this.questName, "/questPics/oldManQuestNegResp.png"),
					false);

			break;
			}
		case 1: {
			this.questNo = map.allQuests.size()-1;
			this.rewardMoney = 250;
			this.questName = "Kära dagbok, jackpot!";
			this.rewardItem = ItemKind.Potion;
			this.dialog = "Du hittade en gömd låda med lite värdesaker i!";
			questPic = "/questPics/itemCache.png";
			break;
			}
		case 2: {
			this.questNo = map.allQuests.size()-1;
			this.rewardMoney = 0;
			this.rewardItem = null;
			this.questName = "Den mystiska mannen";
			this.dialog = "Fogden är efter mig, håll den här!";
			questPic = "/questPics/mysteriousMan.png";
			addAlternative("Okej..?", new Quest(map, 0, ItemKind.StrengthX, "[Du får ett burk med mystiska piller. De här kanske kan komma i användning...]", this.questName ,"/questPics/peels.png"), false);
			break;
			}
		case 3: {
			this.questNo = map.allQuests.size()-1;
			this.rewardMoney = 250;
			this.questName = "Ko ko-ko-ko-ko ko-ko-kokain kokain";
			this.rewardItem = ItemKind.SpeedX;
			this.dialog = "*SNOOOOOOOOOOOORRRRRRRTTT*";
			questPic = "/questPics/cocaine.png";
			break;}
		case 4: {
			this.questNo = map.allQuests.size()-1;
			this.rewardMoney = 250;
			this.questName = "Kan innehålla spår av ande";
			this.rewardItem = ItemKind.WeakPotion;
			this.dialog = "En oöppnad flaska ligger och skräpar här.";
			questPic = "/questPics/weakPotion.png";
			break;}
		case 5: {
			this.questNo = map.allQuests.size()-1;
			this.rewardMoney = 250;
			this.questName = "Kära dagbok, jackpot!";
			this.rewardItem = ItemKind.Potion;
			this.dialog = "Du hittade en gömd låda med lite värdesaker i!";
			questPic = "/questPics/itemCache.png";
			break;}
		case 6: {
			this.questNo = map.allQuests.size()-1;
			this.rewardMoney = 250;
			this.questName = "Kära dagbok, jackpot!";
			this.rewardItem = ItemKind.Potion;
			this.dialog = "Du hittade en gömd låda med lite värdesaker i!";
			questPic = "/questPics/itemCache.png";
			break;}
		case 7: {
			this.questNo = map.allQuests.size()-1;
			this.rewardMoney = 250;
			this.questName = "Kära dagbok, jackpot!";
			this.rewardItem = ItemKind.Potion;
			this.dialog = "Du hittade en gömd låda med lite värdesaker i!";
			questPic = "/questPics/itemCache.png";
			break;}
		case 8: {
			this.questNo = map.allQuests.size()-1;
			this.rewardMoney = 250;
			this.questName = "Kära dagbok, jackpot!";
			this.rewardItem = ItemKind.Potion;
			this.dialog = "Du hittade en gömd låda med lite värdesaker i!";
			questPic = "/questPics/itemCache.png";
			break;}
		case 9: {
			this.questNo = map.allQuests.size()-1;
			this.rewardMoney = 250;
			this.questName = "Kära dagbok, jackpot!";
			this.rewardItem = ItemKind.Potion;
			this.dialog = "Du hittade en gömd låda med lite värdesaker i!";
			questPic = "/questPics/itemCache.png";
			break;}
		}
	}
	
	public void addAlternative(String response, Quest q, boolean onNewNode) {
		alternativeResponses.add(response);
		alternatives.add(q);
		alternativeNewNode.add(onNewNode);
	}
	
	public ArrayList<Quest> setNodeIndex(int nodeIndex) {
		this.nodeIndex = nodeIndex;
		ArrayList<Quest> needsToBeDistributed = new ArrayList<Quest>();
		
		for (int i = 0; i < alternatives.size(); i++) {
			Quest q = alternatives.get(i);
			if (alternativeNewNode.get(i)) {
				needsToBeDistributed.add(q);
			} else {
				q.setNodeIndex(nodeIndex);
			}
		}
		
		return needsToBeDistributed;
	}
	
	public void getRewards(Player player, MapNode node) {
		if (alternatives.isEmpty()) {
			player.finishQuest(questNo);
			node.activeQuestIndex = -1;
		} else if (!player.activeQuests.contains(questNo)) {
			player.activeQuests.add(questNo);
		}
		if (!player.activeQuests.contains(questNo)) {
			player.money += rewardMoney;
			if (rewardItem != null) {
				player.inventory.addItem(rewardItem, 1);
			}
		}
	}
	
	public void chooseAlternative(Map map, Player player, int index) {
		Quest nextQuest = alternatives.get(index);
		
		map.nodes.get(nodeIndex).activeQuestIndex = -1;
		player.finishQuest(questNo);
		map.nodes.get(nextQuest.nodeIndex).activeQuestIndex = nextQuest.questNo;
		player.activeQuests.add(nextQuest.questNo);
	}*/
		
}
